import {ipcRenderer} from 'electron'
import fs from 'fs'
import Sequelize from "sequelize";
export default {
    sys_close() {
        console.log('sys_close');
        ipcRenderer.send('sys_close');
    },
    sys_max(callback) {
        console.log('sys_max');
        ipcRenderer.send('sys_max');
        ipcRenderer.on('isMaximized', function (event, val) {
            callback(val);
        });
    },
    sys_mini() {
        console.log('sys_mini');
        ipcRenderer.send('sys_mini');
    },
    sys_readfile() {
        const pdfData = fs.readFileSync()
    },
    sys_initSequelize() {
        const sequelize = new Sequelize('', config.username, config.password, {
            host: config.address,
            dialect: config.sqltype,
            port: config.port, //-------------> change port here
            driver: 'tedious',
            dialectOptions: {
                instanceName: MSSQLSERVER
            },
            define: {
                timestamps: false
            },
            pool: {
                max: 5,
                min: 0,
                idle: 10000
            },
        })
    },
}
